package day5;

import day4.teacher.MathTeacher;
import day4.teacher.PETeacher;

/**
 * @author oldliu
 * @since 1.0
 */
public class ObjTest {
    public static void main(String[] args) {
        Object o=new MathTeacher("小黄",24);
        //o.giveLession();
        System.out.println(o);//自动调用toString方法的返回值

//        MathTeacher m=(MathTeacher)o;
//        m.giveLession();
//        m.selfIntro();
//        m.huayuan();
        if(o instanceof PETeacher){
            PETeacher p=(PETeacher)o;
            p.selfIntro();
            p.giveLession();
        }else{
            System.out.println("这不是体育老师");
        }

    }
}
